package com.chance.cc.crawler.prod.command.trigger.domain.vm.xcar.trace;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.vm.xcar.trace.XcarSeriesArticleTraceCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @ClassName song
 * @Description TODO
 * @Author ding
 * @Date 2021/8/29 10:53
 * @Version 1.0
 * 爱卡车系文章 回溯
 **/

public class XcarArticleTraceScheduleTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {
        CrawlerJob crawlerJob = XcarSeriesArticleTraceCrawlerScheduleJob.xcarCwalerJob();
        //publishXcarSeriesScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
        publishXcarSeriesScheduleTriggerInfoTest(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    public static void publishXcarSeriesScheduleTriggerInfoTest(String crawlerKey,String crawlerTriggerKey){
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                XcarSeriesArticleTraceCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "爱卡汽车车系页板块临时采集一次七天内文章评论，评论互动量，文章，文章互动量");
        System.out.println("添加采集调度： "+page.getRawText());
    }
    public static void publishXcarSeriesScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                XcarSeriesArticleTraceCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "0 0 10 * * ?",
                "爱卡汽车车系页板每天10点采集一次七天内文章评论，评论互动量，文章，文章互动量");
        System.out.println("添加采集调度： "+page.getRawText());
    }
}
